<?php require('connections/con_gl.php'); ?>
<?php
cekAkses($_SESSION[akses],"A-3-2");
$colname_edit = "-1";
if (isset($_GET['id'])) {
  $colname_edit = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']);
}
mysql_select_db($database_con_gl, $con_gl);
$query_edit = sprintf("SELECT * FROM gl_klas WHERE kd = %s", $colname_edit);
$edit = mysql_query($query_edit, $con_gl) or die(mysql_error());
$row_edit = mysql_fetch_assoc($edit);
$totalRows_edit = mysql_num_rows($edit);
?>
<link type="text/css" rel="stylesheet" href="css/jquery.wysiwyg.css" />
<script type="text/javascript" src="js/jquery.wysiwyg.js"></script>
<script type="text/javascript">
$(document).ready(function() {

	$().ajaxStart(function() {
		$('#loading').show();
		$('#result').hide();
	}).ajaxStop(function() {
		$('#loading').hide();
		$('#result').fadeIn('slow');
	});

	$('#edit').submit(function() {
		$.ajax({
			type: 'POST',
			url: $(this).attr('action'),
			data: $(this).serialize(),
			success: function(data) {
				$('#result').html(data);
			}
		})
		return false;
	});
  $('#result').click(function(){
  $(this).hide();
  });
})
$(function()
  {
      $('#keterangan').wysiwyg();
  });
</script>
<div id="loading" style="display:none;"><img src="images/loading.gif" alt="loading..." /></div>
<div id="result" style="display:none;"></div>
<h1>Edit Klasifikasi Akun </h1>
<form action="proses/klasifikasiakun.php?act=edit" method="POST" name="edit" id="edit" >
  <table width="100%" border="0" align="center" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF" class="datatable">
    <tr>
      <td width="18%" align="right">Kode* : </td>
      <td width="82%"><label>
        <input name="kode" type="text" id="kode" value="<?php echo $row_edit['kd']; ?>" size="15" maxlength="10" onFocus="this.blur();"/>
      (number only) </label></td>
    </tr>
    <tr>
      <td align="right">Klasifikasi*  : </td>
      <td><label>
        <input name="klasifikasi" type="text" id="klasifikasi" value="<?php echo $row_edit['klasifikasi']; ?>" size="30" maxlength="100"/>
      </label></td>
    </tr>
    <tr valign="top">
      <td align="right">Neraca : </td>
      <td><label>
        <select name="neraca" id="neraca" style="width:180px;">
          <option value="0" <?php if (!(strcmp(0, $row_edit['neraca']))) {echo "selected=\"selected\"";} ?>>Tidak diset</option>
<option value="1" <?php if (!(strcmp(1, $row_edit['neraca']))) {echo "selected=\"selected\"";} ?>>Aktiva</option>
          <option value="2" <?php if (!(strcmp(2, $row_edit['neraca']))) {echo "selected=\"selected\"";} ?>>Pasiva</option>
        </select>
      </label></td>
    </tr>
    <tr valign="top">
      <td align="right">Rugi/Laba : </td>
      <td><label>
        <select name="rugilaba" id="rugilaba" style="width:180px;">
          <option value="0" selected="selected" <?php if (!(strcmp(0, $row_edit['ruglab']))) {echo "selected=\"selected\"";} ?>>Tidak diset</option>
<option value="1" <?php if (!(strcmp(1, $row_edit['ruglab']))) {echo "selected=\"selected\"";} ?>>Set Penghasilan Usaha</option>
          <option value="2" <?php if (!(strcmp(2, $row_edit['ruglab']))) {echo "selected=\"selected\"";} ?>>Set Beban Usaha</option>
        </select>
      </label></td>
    </tr>
    <tr valign="top">
      <td align="right">Tipe : </td>
      <td><label>
        <select name="tipe" id="tipe" style="width:180px;">
          <option value="0" selected="selected" <?php if (!(strcmp(0, $row_edit['tipe']))) {echo "selected=\"selected\"";} ?>>Tidak diset</option>
<option value="2" <?php if (!(strcmp(2, $row_edit['tipe']))) {echo "selected=\"selected\"";} ?>>Kas &amp; Bank</option>
          <option value="3" <?php if (!(strcmp(3, $row_edit['tipe']))) {echo "selected=\"selected\"";} ?>>Persediaan</option>
          <option value="4" <?php if (!(strcmp(4, $row_edit['tipe']))) {echo "selected=\"selected\"";} ?>>HPP</option>
          <option value="5" <?php if (!(strcmp(5, $row_edit['tipe']))) {echo "selected=\"selected\"";} ?>>Penjualan</option>
          <option value="6" <?php if (!(strcmp(6, $row_edit['tipe']))) {echo "selected=\"selected\"";} ?>>Piutang</option>
          <option value="7" <?php if (!(strcmp(7, $row_edit['tipe']))) {echo "selected=\"selected\"";} ?>>Hutang</option>
          <option value="8" <?php if (!(strcmp(8, $row_edit['tipe']))) {echo "selected=\"selected\"";} ?>>Penawaran</option>
          <option value="9" <?php if (!(strcmp(9, $row_edit['tipe']))) {echo "selected=\"selected\"";} ?>>Pajak</option>
          <option value="10" <?php if (!(strcmp(10, $row_edit['tipe']))) {echo "selected=\"selected\"";} ?>>Biaya Lain</option>
        </select>
      </label></td>
    </tr>
    <tr valign="top">
      <td align="right">Keterangan : </td>
      <td><label>
        <textarea name="keterangan" cols="85" rows="5" id="keterangan"><?php echo $row_edit['keterangan']; ?></textarea>
      </label></td>
    </tr>
    <tr>
      <td align="left"><label><em>*Harus diisi</em></label></td>
      <td><label>
        <input name="Save" type="submit" id="Save" value="Simpan" />
        </label>
          <label>
          <input type="button" name="Button" value="Batal" onClick="javascript:history.go(-1);">
        </label></td>
    </tr>
  </table>
  <input type="hidden" name="MM_insert" value="add">
  <input type="hidden" name="MM_update" value="add">
</form>
<?php
mysql_free_result($edit);
?>
